﻿
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using System.Xml;
using System.Windows.Documents;
using 卷书;

namespace 卷书
{
    /// <summary>
    /// Settings.xaml 的交互逻辑
    /// </summary>
    public partial class Dialog_Input : BaseDialog
    {

        public string InputText="";
        private string path = "";
        private string originname = "";

        public Dialog_Input(Window owner, bool showbutton,string text) : base(owner, showbutton)
        {
            InitializeComponent();
            path = System.IO.Path.GetDirectoryName(text);
            originname = System.IO.Path.GetFileNameWithoutExtension(text);
            txt.Text = originname;
        }

        private void txt_TextChanged(object sender, TextChangedEventArgs e)
        {
            InputText = txt.Text;
            if(InputText!=originname && File.Exists(Path.Combine(path,InputText + ".volumebook")))
            {
                status.Text = "文件已存在";
            }
            else
            {
                status.Text = " ";
            }
        }
    }
}